//
//  UIView+Frame.m
//  青旅O2O
//
//  Created by qlwl on 16/6/12.
//  Copyright © 2016年 qlwl. All rights reserved.
//

#import "UIView+Frame.h"

@implementation UIView (Frame)
- (void)setX:(CGFloat)x
{
    CGRect frame = self.frame;
    frame.origin.x = x;
    self.frame = frame;
}

- (CGFloat)x
{
    return self.frame.origin.x;
}


- (void)setY:(CGFloat)y
{
    CGRect frame = self.frame;
    frame.origin.y = y;
    self.frame = frame;
}

- (CGFloat)y
{
    return self.frame.origin.y;
}

- (void)setW:(CGFloat)w
{
    CGRect frame = self.frame;
    frame.size.width = w;
    self.frame = frame;
}

- (CGFloat)w
{
    return self.frame.size.width;
}
- (void)setB_w:(CGFloat)b_w
{
    CGRect bounds = self.bounds;
    bounds.size.width = b_w;
    self.bounds = bounds;
}
- (CGFloat)b_w
{
    return self.bounds.size.width;
}


- (void)setH:(CGFloat)h
{
    CGRect frame = self.frame;
    frame.size.height = h;
    self.frame = frame;
}

- (CGFloat)h
{
    return self.frame.size.height;
}

- (void)setB_h:(CGFloat)b_h
{
    CGRect bounds = self.bounds;
    bounds.size.height = b_h;
    self.bounds = bounds;
}
- (CGFloat)b_h
{
    return self.bounds.size.height;
}

- (void)setSize:(CGSize)size
{
    CGRect frame = self.frame;
    frame.size = size;
    self.frame = frame;
}

- (CGSize)size
{
    return self.frame.size;
}

- (void)setB_size:(CGSize)b_size
{
    CGRect bounds = self.bounds;
    bounds.size = b_size;
    self.bounds = bounds;
}
- (CGSize)b_size
{
    return self.bounds.size;
}

- (void)setF_center:(CGPoint)f_center
{
    self.center = f_center;
}
- (CGPoint)f_center
{
    return self.center;
}

- (CGPoint)b_center
{
    CGRect bounds = self.bounds;
    CGPoint center = CGPointMake(bounds.size.width/2, bounds.size.height/2);
    return center;
}

- (void)setOrigin:(CGPoint)origin
{
    CGRect frame = self.frame;
    frame.origin = origin;
    self.frame = frame;
}

- (CGPoint)origin
{
    return self.frame.origin;
}


@end
